# Contributor: Artyom Smirnov <smirnoffjr@gmail.com>
pkgname=repo-clean-svn
pkgver=84
pkgrel=1
pkgdesc="Clean utility for Pacman repository"
arch=('i686' 'x86_64')
url="http://code.google.com/p/repo-clean/"
license=('GPL')
depends=('pacman' 'boost')
makedepends=('scons>=0.98' 'gcc' 'subversion')
provides=(repo-clean)
conflicts=(repo-clean)
source=()
md5sums=()

_svntrunk=http://repo-clean.googlecode.com/svn/trunk/
_svnmod=repo-clean

build() {
  cd $srcdir

  if [ -d $_svnmod/.svn ]; then
    (cd $_svnmod && svn up -r $pkgver)
  else
    svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
  fi

  msg "SVN checkout done or server timeout"
  msg "Starting make..."

  rm -rf $_svnmod-build
  cp -r $_svnmod $_svnmod-build
  cd $_svnmod-build

  scons prefix=/usr || return 1
  scons install destdir=$pkgdir
}
